-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Ethernet - Arduino Ethernet API compatibility layer #9522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Hello JAndrassy, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
11cccb6
to
aae0d5b
Compare
aae0d5b
to
8698fef
Compare
Hi @JAndrassy We can accept your changes to ETH.h and ETH.cpp, but we think that the extra compatibility layer deserves it's own external library. Please remove the compatibility layer, so that we can merge your changes |
@me-no-dev, what is an "external library"? |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
External Library means that is hosted somewhere else. Usually github and is registered with Arduino libraries, so people can find it. |
the changes in ETH.h start with |
You can keep all changes in ETH, including that. |
new PR #9539 |
@me-no-dev I published the 'external library'. It uses IDF directly to add support for enc28j60. Implementation diffrences:
|
@JAndrassy periman is a good thing to have :) maybe add the library to the list of tested external libs here? |
This PR adds legacy Arduino Ethernet API as a wrapper class for ETH object.
The filename EthernetCompat.h is the same as in the esp8266 Arduino.
In legacy Arduino Ethernet API static IP parameters are parameters of
begin
. To set pins Arduino uses optionalinit
method.Default setting in the wrapper is W5500 on default SPI pins with SS as CS. Default IRQ pin is 4 as in ETH (conflicting with SCK for C2 and C3).
Instance named
Ethernet
is created. It wraps the ETH instance. It is possible to create additional instances.EthernetClient, EthernetServer and EthernetUdp are preprocessor macros (same way as their WiFi counterparts).
The example is taken from the Arduino Ethernet library. Only the comment about
init
is modified.Tested with 'classic' ESP32 with W5500 on SPI with default pins and alternative pins and with spi_host2 on default and alternative pins. I will try to test with LAN8720 and maybe with a C3 with W5500.
Test sketch was LegacyEthernetTest from my NetAPIHelpers library and the new example.